package com.nineclock.auth.controller;

import com.nineclock.auth.service.SysUserService;
import com.nineclock.common.entity.Result;
import com.nineclock.system.dto.SysUserDTO;
import com.nineclock.system.feign.SysUserFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
public class SysUserController implements SysUserFeign {

    @Autowired
    SysUserService sysUserService;

    @Override
    @GetMapping("/query")
    public Result<SysUserDTO> queryUser(@RequestParam("username") String username) {
        SysUserDTO sysUserDTO= sysUserService.queryUser(username);
        return Result.success(sysUserDTO);
    }
}
